use rpc::{RpcChannel, RpcContext, RpcResult};
use rpc_derive::{rpc_router, rpc_service};

#[rpc_router]
pub fn echo_test(_context: &mut RpcContext, data: i32) -> i32 {
    data + 100
}


#[rpc_service(timeout=30)]
#[async_trait::async_trait]
pub trait EchoTestService {

    #[path = "/echo"]
    async fn echo(&mut self, channel: &mut impl RpcChannel, value: i32) -> RpcResult<i32>;
}